package cn.java89.userservice.web;

import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

import java.util.Date;

/**
 * @author oldliu
 * @since 1.0
 */
@Configuration
@EnableScheduling
public class SchDemo {
    //1分钟执行一次
    @Scheduled(cron = "0 * * * * *")
    public void show() {
        System.out.println("当前时间：：" + new Date());
    }
}
